<?php

require 'Slim/Slim.php';

\Slim\Slim::registerAutoloader();

//$app = new \Slim\Slim();

$app = new \Slim\Slim(array(
    'log.level' => \Slim\Log::DEBUG
));

$log = $app->getLog();

// GET route
$app->get('/', function () {
	echo json_encode("Standard GET");
});


// GET route
$app->get('/getuser/:id', function ($id) {
	echo json_encode("Get by ID: " . $id);
});

// GET route
$app->get('/getallusers', function () {
    $arr = array ('a'=>5,'b'=>2,'c'=>3,'d'=>4,'e'=>5);

	echo json_encode($arr);
});

// POST route
$app->post('/post', function () {
    echo 'This is a POST route';
});

// PUT route
$app->put('/put', function () {
    echo 'This is a PUT route';
});

// DELETE route
$app->delete('/delete', function () {
    echo 'This is a DELETE route';
});
$app->run();